package com.kotlin.flong.reflection

import kotlin.reflect.full.createInstance
import kotlin.reflect.full.functions

/**
 * @Author:liangjl
 * @Date: 2020/7/12-8:52
 * @Eamil:jilongliang@sina.com
 * @Description:
 */
class MyTest11(value: Int = 0) {
    fun printSomeThing() {
        println("do printSomeThing")
    }

    fun printNoThing() {
        println("do printNoThing ")
    }
}

fun main() {
    var myTest11 = MyTest11::class
    var myObj = myTest11.createInstance()
    myTest11.functions.find { it.name == "printSomeThing" }?.call(myObj)
    myTest11.functions.find { it.name == "printNoThing" }?.call(myObj)

}